<?php if ($this->pageCount): ?>
    <div class="pagination">
        
            <!-- Previous page link -->
            <?php if (isset($this->previous)): ?>
                    <a href="<?php echo $this->url($this->route,array('id' => $this->id,'locality'=>$this->locality,'homeservice'=>$this->homeservice,'gender'=>$this->gender,'flavor'=>$this->flavor,'creditcard'=>$this->creditcard,'city'=>$this->city)); ?>?page=<?php echo $this->previous; ?>&sortby=<?php echo $this->sortby; ?>">
                        <<
                    </a>
            <?php else: ?>
                    <a href="#" class="disabled previousButton">
                        Previous
                    </a>
            <?php endif; ?>
            <!-- Numbered page links -->
            <?php foreach ($this->pagesInRange as $page): ?>
                <?php if ($page != $this->current): ?>
                        <a href="<?php echo $this->url($this->route,array('id' => $this->id,'locality'=>$this->locality,'homeservice'=>$this->homeservice,'gender'=>$this->gender,'flavor'=>$this->flavor,'creditcard'=>$this->creditcard,'city'=>$this->city));?>?page=<?php echo $page; ?>&sortby=<?php echo $this->sortby; ?>">
                            <?php echo $page; ?>
                        </a>
                <?php else: ?>
                        <a class="current-page" href="#"><?php echo $page; ?></a>
                <?php endif; ?>
            <?php endforeach; ?>

            <!-- Next page link -->
            <?php if (isset($this->next)): ?>
                    <a href="<?php echo $this->url($this->route,array('id' => $this->id,'locality'=>$this->locality,'homeservice'=>$this->homeservice,'gender'=>$this->gender,'flavor'=>$this->flavor,'creditcard'=>$this->creditcard,'city'=>$this->city)); ?>?page=<?php echo $this->next; ?>&sortby=<?php echo $this->sortby; ?>" class="NextPgBtn">
                        Next
                    </a>
            <?php else: ?>
                    <a class="disabled NextPgBtn" href="#">
                        Next
                    </a>
            <?php endif; ?>
    </div>
<?php endif; ?>